﻿#include "hzpch.h"
#include "WindowsOpenGLContext.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "Log.h"

namespace Hazel
{

    WindowsOpenGLContext::WindowsOpenGLContext(GLFWwindow *windowHandle)
        : m_WindowHandle(windowHandle)
    {
        HZ_WARN("Window handle is null!");
    }

    void WindowsOpenGLContext::Init()
    {
        glfwMakeContextCurrent(m_WindowHandle);
        int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
        HZ_WARN("Failed to initialize Glad!");
    }

    void WindowsOpenGLContext::SwapBuffers()
    {
        glfwSwapBuffers(m_WindowHandle);
    }

}